#ifndef __CARDS_H__
#define __CARDS_H__

#include "ocl_types.h"
#include "ocl_video.h"

//Initialize Library
int CARDS_Init(CARDS_Ptr* out_ptr);

//Destruct Library
void CARDS_Destruct(CARDS_Ptr* in_ptr);

//Draw Routines
void CARDS_RenderCard(const CARDS_Ptr* card_ptr, const VIDEO_Ptr* video_ptr, CARDS_Card* card, int screen_x, int screen_y);
void CARDS_RenderDownCard(const CARDS_Ptr* card_ptr, const VIDEO_Ptr* video_ptr, CARDS_Card* card, int screen_x, int screen_y);

//Card/Screen Management
int CARDS_IsCardClicked(const CARDS_Card card, int screen_x, int screen_y);

//Deck Management
void CARDS_GetNewDeck(CARDS_Deck *deck);
void CARDS_Shuffle(CARDS_Deck *deck);
int  CARDS_DealCard(CARDS_Deck *deck, CARDS_Card *card);
void CARDS_Discard(CARDS_Deck *deck, CARDS_Card card);

//Gaming Functions
CARDS_PairListType CARDS_GetHandPairs(const CARDS_Card *hand, const int hand_size);

int CARDS_IsFlushHand(const CARDS_Card *hand, const int hand_size);

int CARDS_IsStraightHand(const CARDS_Card *hand, const int hand_size);

void CARDS_SortHand(CARDS_Card *hand, const int hand_size);

CARDS_PokerHandType CARDS_GetPokerHandType(CARDS_Card *hand, int total_hand_size, int cards_to_use);

//Returns 0 if hand_0 is better
//Returns 1 if hand_1 is better
//Returns 2 if hands are equal
int CARDS_ComparePokerHand(CARDS_Card *hand_0, int hand_0_size, CARDS_Card *hand_1, int hand_1_size);

//Turn sound for cards on/off
int CARDS_InitSound();
void CARDS_PlayCasinoSound(const CARDS_Ptr* card_ptr);
void CARDS_StopCasinoSound(const CARDS_Ptr* card_ptr);
void CARDS_PlayDealSound(const CARDS_Ptr* card_ptr);
void CARDS_PlayWinSound(const CARDS_Ptr* card_ptr);
void CARDS_PlayFlipSound(const CARDS_Ptr* card_ptr);
void CARDS_PlayCoinSound(const CARDS_Ptr* card_ptr);
void CARDS_PlayPushSound(const CARDS_Ptr* card_ptr);

#endif //__CARDS_H__
